package com.zhangxu.microservice.auth.biz.mapstruct;

import com.zhangxu.microservice.auth.biz.dto.CreateResourceDTO;
import com.zhangxu.microservice.auth.biz.dto.ResourceDTO;
import com.zhangxu.microservice.auth.biz.dto.UpdateResourceDTO;
import com.zhangxu.microservice.auth.dao.entity.ResourceDO;
import org.mapstruct.Mapper;

/**
 * 资源对象转换接口
 */
@Mapper(componentModel = "spring")
public interface ResourceConverter {

    /**
     * ResourceDO 转 ResourceDTO
     *
     * @param resourceDO 资源DO
     * @return 资源DTO
     */
    ResourceDTO toResourceDTO(ResourceDO resourceDO);

    /**
     * CreateResourceDTO 转 ResourceDO
     *
     * @param createResourceDTO 创建资源DTO
     * @return 资源DO
     */
    ResourceDO toResourceDO(CreateResourceDTO createResourceDTO);

    /**
     * UpdateResourceDTO 转 ResourceDO
     *
     * @param updateResourceDTO 更新资源DTO
     * @return 资源DO
     */
    ResourceDO toResourceDO(UpdateResourceDTO updateResourceDTO);
}